#pragma once

namespace krryn{
namespace view{ class model; }
namespace animation{
	class skeleton;

	class animation{
	public:
		animation(view::model *a_Model, float a_FrameRate, unsigned int a_NumFrames);
		~animation();

		void update(float a_DT);

		void set_skeleton(size_t i, skeleton *a_Skeleton);
		skeleton *get_current() const;
		skeleton *get_next() const;
		int num_frames() const { return m_NumFrames; }
		float get_interpolation_factor() const { return m_LastTime * m_FrameRate; }
	private:
		void dump();

		float m_LastTime;
		float m_MaxTime;
		float m_FrameRate;

		int m_CurrentFrame;
		int m_NextFrame;
		int m_NumFrames;

		view::model *m_Model;

		skeleton **m_Skeletons;
	};
}
}